package com.yazi.mxz.common.entity.beans;

import javax.persistence.Column;
import javax.persistence.Embeddable;

/**
 * MemberVipId entity. @author MyEclipse Persistence Tools
 */
@Embeddable
public class MemberVipId implements java.io.Serializable {

	// Fields

	private Long companyId;
	private Long memberId;

	// Constructors

	/** default constructor */
	public MemberVipId() {
	}

	/** full constructor */
	public MemberVipId(Long companyId, Long memberId) {
		this.companyId = companyId;
		this.memberId = memberId;
	}

	// Property accessors

	@Column(name = "COMPANY_ID", nullable = false, precision = 15, scale = 0)
	public Long getCompanyId() {
		return this.companyId;
	}

	public void setCompanyId(Long companyId) {
		this.companyId = companyId;
	}

	@Column(name = "MEMBER_ID", nullable = false, precision = 15, scale = 0)
	public Long getMemberId() {
		return this.memberId;
	}

	public void setMemberId(Long memberId) {
		this.memberId = memberId;
	}

	public boolean equals(Object other) {
		if ((this == other))
			return true;
		if ((other == null))
			return false;
		if (!(other instanceof MemberVipId))
			return false;
		MemberVipId castOther = (MemberVipId) other;

		return ((this.getCompanyId() == castOther.getCompanyId()) || (this
				.getCompanyId() != null && castOther.getCompanyId() != null && this
				.getCompanyId().equals(castOther.getCompanyId())))
				&& ((this.getMemberId() == castOther.getMemberId()) || (this
						.getMemberId() != null
						&& castOther.getMemberId() != null && this
						.getMemberId().equals(castOther.getMemberId())));
	}

	public int hashCode() {
		int result = 17;

		result = 37 * result
				+ (getCompanyId() == null ? 0 : this.getCompanyId().hashCode());
		result = 37 * result
				+ (getMemberId() == null ? 0 : this.getMemberId().hashCode());
		return result;
	}

}